package org.sky.service.serviceImpl;

import org.sky.base.DaoSupport;
import org.sky.model.Evaluate;
import org.sky.service.EvaluateService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.Query;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 12-11-7
 * Time: 下午6:22
 * To change this template use FileUtil | Settings | FileUtil Templates.
 */

@Service
@Transactional
public class EvaluateServiceImpl extends DaoSupport<Evaluate> implements EvaluateService {

    @Override
    public List<Evaluate> findEvaluates(int fileId) {
        Query query = em.createQuery("select o from Evaluate o where o.file.id="+fileId+" and o.evaluate!=''");
        return query.getResultList();
    }
}
